<?php
//插入数据

    include 'db.php';

    $name = $_POST['name'];
    $content = $_POST['content'];

    $sql = "INSERT INTO message
            (name, content) values
            ('$name', '$content')";

    if($conn->query($sql)===true){
        echo '插入成功！';
        header('location:index.php');
        exit;
    }
    else {
        echo '插入失败！'.$conn->error;
    }
    $conn->close();

?>